// UIContainer.cpp : implementation file
//

#include "stdafx.h"

#include "UIContainer.h"
#include "PEProtocol.h"
#include "AppTools.h"

// CUIContainer dialog


IMPLEMENT_DYNCREATE(CUIContainer, CDHtmlDialog)

CUIContainer::CUIContainer(CWnd* pParent /*=NULL*/)
	: CDHtmlDialog(CUIContainer::IDD, CUIContainer::IDH, pParent)
{
}

CUIContainer::~CUIContainer()
{
}

void CUIContainer::DoDataExchange(CDataExchange* pDX)
{
	CDHtmlDialog::DoDataExchange(pDX);
}


// CUIContainer message handlers

void CUIContainer::LoadPage()
{
	extern int g_iPCPort;
	
	FILETIME ftNow;
	SYSTEMTIME stNow;
	GetLocalTime(&stNow);
	SystemTimeToFileTime(&stNow,&ftNow);

	_stprintf(m_szURL,_T("Http://127.0.0.1:%d/%ul/index.html"),g_iPCPort,ftNow.dwLowDateTime);

	Navigate(m_szURL);
}

BOOL CUIContainer::AdjustSize(int iW,int iH)
{
	m_width = iW;
	m_height = iH;

	RECT r;
	GetParent()->GetClientRect(&r);

	MoveWindow( 30,130,m_width,m_height);

	return TRUE;
}


void CUIContainer::OnClose()
{
	ShowWindow(SW_HIDE);
}



